package org.jim.server.demo.service.processor;

import org.jim.core.ImChannelContext;
import org.jim.core.packets.*;
import org.jim.server.processor.GetGroupListCmdProcessor;
import org.jim.server.protocol.AbstractProtocolCmdProcessor;
import org.jim.server.util.ImServerKit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author lml
 */
@Configuration
public class GetGroupListServiceProcessor extends AbstractProtocolCmdProcessor implements GetGroupListCmdProcessor {

    private static final Logger log = LoggerFactory.getLogger(GetGroupListServiceProcessor.class);

    @Override
    public List<Group> getList(GetGroupListBody loginReqBody, ImChannelContext imChannelContext) {


        List<Group> groups = ImServerKit.getGroupsByUserId(loginReqBody.getUserId());

        return groups;
    }
}
